<?php echo $this->Session->flash(); ?>
<?php echo $ajax->link($html->image('regresar.gif', array('width' => '30', 'heigth' => '30', 'alt' => 'Regresar', 'title' => 'regresar')), array('controller' => 'calls', 'action' => 'index'), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading', 'escape' => false)); ?>
<br>
<table id="tabla" class="tabla" >
    <thead>
        <tr>
            <th>ID </th>
            <th>TEXTO</th>
            <th>TIPO</th>
            <th colspan="3">OPCIONES</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($requisitos as $rec): ?>
            <tr>
                <?php
                $tipo = "";
                switch ($rec['Requirement']['requirement_type_id']) {
                    case 0:
                        $tipo = "Sin registro";
                        break;
                    case 1:
                        $tipo = "Proyecto";
                        break;
                    case 2:
                        $tipo = "Campesino cabeza de familia";
                        break;
                    case 3:
                        $tipo = "Predios";
                        break;
                    case 4:
                        $tipo = "Desplazado cabeza de familia";
                        break;
                    case 5:
                        $tipo = "Profesional cabeza de familia";
                        break;
                    case 6:
                        $tipo = "Conyugue Campesino";
                        break;
                    case 7:
                        $tipo = "Conyugue Desplazado";
                        break;
                    case 8:
                        $tipo = "Conyugue Profesional";
                        break;
                    case 9:
                        $tipo = "Estudio de titulos";
                        break;
                    default:
                        $tipo = "Sin registro";
                        break;
                }
                ?>
                <td><?php echo $rec['Requirement']['id'] ?></td>
                <td><?php echo $rec['Requirement']['texto'] ?></td>
                <td><?php echo $tipo ?></td>
                <td><?php echo $ajax->link('Ver_restricciones', array('controller' => 'RequirementFaults', 'action' => 'index', $rec['Requirement']['id']), array('update' => 'content', 'class' => 'actions')) ?></td>
                <td><?php echo $ajax->link('Editar', array('controller' => 'Requirements', 'action' => 'edit', $rec['Requirement']['id']), array('update' => 'content', 'complete' => 'cargar()', 'class' => 'actions')) ?></td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<br>
<?php echo $ajax->link('ADICIONAR REQUISITO', array('controller' => 'Requirements', 'action' => 'add', $call_id), array('update' => 'content', 'complete' => 'cargar()', 'class' => 'actions')) ?>
<br><br>
<?php echo $ajax->link($html->image('regresar.gif', array('width' => '30', 'heigth' => '30', 'alt' => 'Regresar', 'title' => 'regresar')), array('controller' => 'calls', 'action' => 'index'), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading', 'escape' => false)); ?>